package com.example.userprovider.mapper;


import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.myshop.b2b.commonmodule.User;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Param;
import org.apache.ibatis.annotations.Select;

/**
* @author likaiping
* @description 针对表【user】的数据库操作Mapper
* @createDate 2024-07-02 17:23:22
* @Entity com.example.userprovider.pojo.User
*/
public interface UserMapper extends BaseMapper<User> {
    /**
     * 用户注册接口
     * @param upassword
     * @param uname
     * @param usex
     * @return
     */
    @Insert("INSERT INTO USER(upassword,uname,usex) VALUES(#{upassword},#{uname},#{usex})")
    int register(@Param(value = "upassword")String upassword,
                 @Param(value = "uname")String uname,
                 @Param(value = "usex") String usex);

    /**
     * 用户登录接口
     * @param uname
     * @return
     */
    @Select("select * from user where uname=#{uname}")
    User login(@Param(value = "uname") String uname);
}




